package com.lgc.webtest.controller;

import com.lgc.webtest.service.RedisService;
import com.lgc.webtest.service.SingleRedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 所有聚合类型：lists，sets, Sorted Sets 和 Hashes，当为空时，Redis都会自动将其删除！
 */
@RestController
@RequestMapping("/redis")
public class RedisController {

//    @Autowired
//    private RedisService redisService;

    /*@RequestMapping("/index")
    public String index(){
        redisService.testRedisDistributedLock();

        return "index";
    }

    *//**
     * 集合set
     * @return
     *//*
    @RequestMapping("/testInteger")
    public String testInteger(){
        redisService.saveInteger();

        return "testInteger";
    }

    *//**
     * 集合set
     * @return
     *//*
    @RequestMapping("/testCollectionSet")
    public String testCollectionSet(){
        redisService.testCollectionSet();

        return "testCollectionSet";
    }

    *//**
     * 集合List
     * @return
     *//*
    @RequestMapping("/testCollectionList")
    public String testCollectionList(){
        redisService.testCollectionList();

        return "testCollectionSet";
    }

    @RequestMapping("/del_redis_value")
    public String del_redis_value(String key){
        redisService.delRedisValue(key);

        return "del_redis_value";
    }

    @RequestMapping("/get_redis_value")
    public String del_redis_value(String key,int isList){
        return redisService.getRedisValue(key,isList);
    }*/
}
